package com.karal.javase.cher03;

/**
 * @TODO
 * @Author xu
 * 2025/3/6
 */
public class Computer {
    public void exchangeData(StorageDevice device) {
        device.read();
        device.write();

        // 如果是MP3播放器，则播放音乐
        if (device instanceof MP3Player) {
            ((MP3Player) device).playMusic();
        }
    }
}
